package org.easyelf.springmvc.plugins.easyui;

import java.util.ArrayList;
import java.util.List;

public class DataPageGrid<T> implements java.io.Serializable {

	private Integer total=0;
	private String page; //1
	private String sort = ""; //signdate
	private String order = ""; //desc
	private Integer pageSize; //10
	private Integer pageNumber; //1
	private String orderby; //signdate desc
		
	public List<T> rows = new ArrayList<T>();

	public boolean validSortOrder(){
		//字母中文数字、空格、[]、下划线
		String regex = "^[\\w\\s,\\[\\]\u4e00-\u9fa5]*$"; //"^\\w*$";
		if(sort!=null&&order!=null&&
				sort.matches(regex)&&order.matches(regex)){
			return true;
		}
		return false;
	}

	public Integer getTotal() {
		return total;
	}


	public void setTotal(Integer total) {
		this.total = total;
	}


	public String getPage() {
		return page;
	}


	public void setPage(String page) {
		this.page = page;
	}


	public String getSort() {
		return sort;
	}


	public void setSort(String sort) {
		this.sort = sort;
	}


	public String getOrder() {
		return order;
	}


	public void setOrder(String order) {
		this.order = order;
	}


	public Integer getPageSize() {
		return pageSize;
	}


	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}


	public Integer getPageNumber() {
		return pageNumber;
	}


	public void setPageNumber(Integer pageNumber) {
		this.pageNumber = pageNumber;
	}


	public String getOrderby() {
		return orderby;
	}


	public void setOrderby(String orderby) {
		this.orderby = orderby;
	}


	public List<T> getRows() {
		return rows;
	}


	public void setRows(List<T> rows) {
		this.rows = rows;
	}

	

}
